package uk.co.mmscomputing.device.sane;

public interface SaneConstants {

    // ----- SANE commands -----

    static public final int SANE_FALSE = 0;
    static public final int SANE_TRUE = 1;

    /** everything A-OK 一切都好 */
    static public final int SANE_STATUS_GOOD = 0;
    /** operation is not supported 不支持此操作 */
    static public final int SANE_STATUS_UNSUPPORTED = 1;
    /** operation was cancelled 操作已取消 */
    static public final int SANE_STATUS_CANCELLED = 2;
    /** device is busy; try again later 设备忙; 请稍后再试 */
    static public final int SANE_STATUS_DEVICE_BUSY = 3;
    /** data is invalid (includes no dev at open) 数据无效(打开时不包括dev) */
    static public final int SANE_STATUS_INVAL = 4;
    /** no more data available (end-of-file) 没有更多可用数据(文件结尾) */
    static public final int SANE_STATUS_EOF = 5;
    /** document feeder jammed 文档进纸器卡住 */
    static public final int SANE_STATUS_JAMMED = 6;
    /** document feeder out of documents 文档进纸器出纸 */
    static public final int SANE_STATUS_NO_DOCS = 7;
    /** scanner cover is open 扫描仪盖打开 */
    static public final int SANE_STATUS_COVER_OPEN = 8;
    /** error during device I/O 设备I/O期间错误 */
    static public final int SANE_STATUS_IO_ERROR = 9;
    /** out of memory 内存不足 */
    static public final int SANE_STATUS_NO_MEM = 10;
    /** access to resource has been denied 对资源的访问被拒绝 */
    static public final int SANE_STATUS_ACCESS_DENIED = 11;

    static public final int SANE_TYPE_BOOL = 0;
    static public final int SANE_TYPE_INT = 1;
    static public final int SANE_TYPE_FIXED = 2;
    static public final int SANE_TYPE_STRING = 3;
    static public final int SANE_TYPE_BUTTON = 4;
    static public final int SANE_TYPE_GROUP = 5;

    static public final String[] SANE_TYPE = { "BOOL", "INT", "FIXED", "STRING", "BUTTON", "GROUP" };

    /** the value is unit-less (e.g., # of scans) 该值小于单位(例如#次扫描) */
    static public final int SANE_UNIT_NONE = 0;
    /** value is number of pixels 值是像素数 */
    static public final int SANE_UNIT_PIXEL = 1;
    /** value is number of bits 值是位数 */
    static public final int SANE_UNIT_BIT = 2;
    /** value is millimeters 数值为毫米 */
    static public final int SANE_UNIT_MM = 3;
    /** value is resolution in dots/inch 值是分辨率, 单位为点/英寸 */
    static public final int SANE_UNIT_DPI = 4;
    /** value is a percentage 值是百分比 */
    static public final int SANE_UNIT_PERCENT = 5;
    /** value is micro seconds 数值为微秒 */
    static public final int SANE_UNIT_MICROSECOND = 6;

    static public final String[] SANE_UNIT = { "NONE", "PIXEL", "BIT", "MM", "DPI", "PERCENT", "MICROSECOND" };

    static public final int SANE_CAP_SOFT_SELECT = (1 << 0);
    static public final int SANE_CAP_HARD_SELECT = (1 << 1);
    static public final int SANE_CAP_SOFT_DETECT = (1 << 2);
    static public final int SANE_CAP_EMULATED = (1 << 3);
    static public final int SANE_CAP_AUTOMATIC = (1 << 4);
    static public final int SANE_CAP_INACTIVE = (1 << 5);
    static public final int SANE_CAP_ADVANCED = (1 << 6);
    static public final int SANE_CAP_ALWAYS_SETTABLE = (1 << 7);

    static public final String[] SANE_CAP = { "SOFT_SELECT", "HARD_SELECT", "SOFT_DETECT", "EMULATED", "AUTOMATIC",
            "INACTIVE", "ADVANCED", "ALWAYS_SETTABLE" };

    // #define SANE_OPTION_IS_ACTIVE(cap) (((cap) & SANE_CAP_INACTIVE) == 0)
    // #define SANE_OPTION_IS_SETTABLE(cap) (((cap) & SANE_CAP_SOFT_SELECT) != 0)

    static public final int SANE_INFO_INEXACT = (1 << 0);
    static public final int SANE_INFO_RELOAD_OPTIONS = (1 << 1);
    static public final int SANE_INFO_RELOAD_PARAMS = (1 << 2);

    /** band covering human visual range 覆盖人类视觉范围的波段 */
    static public final int SANE_FRAME_GRAY = 0;
    /** pixel-interleaved red/green/blue bands 像素交叉红/绿/蓝波段 */
    static public final int SANE_FRAME_RGB = 1;
    /** red band only 仅红色波段 */
    static public final int SANE_FRAME_RED = 2;
    /** green band only */
    static public final int SANE_FRAME_GREEN = 3;
    /** blue band only */
    static public final int SANE_FRAME_BLUE = 4;

    static public final int SANE_FRAME_TEXT = 10;
    static public final int SANE_FRAME_JPEG = 11;
    static public final int SANE_FRAME_G31D = 12;
    static public final int SANE_FRAME_G32D = 13;
    static public final int SANE_FRAME_G42D = 14;

    static public final String[] SANE_FRAME = { "GRAY", "RGB", "RED", "GREEN", "BLUE", "?", "?", "?", "?", "?", "TEXT",
            "JPEG", "G31D", "G32D", "G42D" };

    static public final int SANE_FIXED_SCALE_SHIFT = 16;

    // mmsc state machine additions mmsc状态机增加

    static public final int SANE_STATE_INITIALIZE = 0;
    static public final int SANE_STATE_OPEN = 1;
    static public final int SANE_STATE_READY = 2;
    static public final int SANE_STATE_CANCELLED = 3;
    static public final int SANE_STATE_CLOSED = 4;
    static public final int SANE_STATE_EXIT = 5;

    static public final String[] SANE_STATE = { "INITIALIZE", "OPEN", "READY", "CANCELLED", "CLOSED", "EXIT" };

}